1. Field of the Invention
The present invention relates to an image processing apparatus and image processing method that control and manage code information for rendering, particularly code information for rendering characters, and an image forming apparatus that employs the image processing apparatus and image processing method.
2. Description of the Prior Art
FIG. 19 is a block diagram showing an example of a general image forming apparatus. On the rendering, the reference numeral 1 designates an input analysis unit; 2, a character data processing unit; 3, a graphics data processing unit; 4, an image data processing unit; 5, an intermediate code processing unit; 6, a band buffer; and 7, an output unit. The input forming apparatus shown in FIG. 19 receives input data such as data described by a page description language or the like, and temporarily converts it into intermediate codes before performing rendering processing to form an image.
The input data analysis unit 1 analyzes input data described by, e.g., a page description language, and classifies it according to rendering types. Herein, the input data falls into three categories: character, graphics, and image. The classified input data is, according to the respective types, passed to the character data processing unit 2, the graphics data processing unit 3, and the image data processing unit 4.
The character data processing unit 2 converts the input data to render a character, passed from the input data analysis unit 1, into an intermediate code and outputs it to the intermediate code processing unit 5. Likewise, the graphics data processing unit 3 converts the input data to render graphics and the like, passed from the input data analysis unit 1, into an intermediate code and outputs it to the intermediate code processing unit 5. The image data processing unit 4 converts input data including the image data to render into an intermediate code and outputs it to the intermediate code processing unit 5.
The intermediate code processing unit 5 accumulates intermediate codes passed from the character data processing unit 2, the graphics data processing unit 3, and the image data processing unit 4, and when one page of intermediate codes has been accumulated, decodes the intermediate codes to perform rendering processing, and stores an image in the band buffer 6.
The output unit 7 fetches an image from the band buffer 6 and forms it on a recording medium such as recording paper.
FIG. 20 is a block diagram showing an example of the character data processing unit and the intermediate code processing unit. On the rendering, the reference numeral 11 designates a character data management unit; 12, a character data generation unit; 13, a font cache buffer; 14, an intermediate code management unit; and 15, an intermediate code buffer. Input data (hereinafter referred to as character data) classified as “character” by the input data analysis unit 1 of FIG. 19 is inputted to the character data management unit 11. Character data includes font, size, direction, character code, color, printing position, and other information.
Upon input of character data, the character data management unit 11 converts the character data into an intermediate code containing information such as the shape data and rendering position of the characters. At this time, the character data management unit 11 searches the font cache buffer 13 for the shape data of a character indicated by the character data, and if not found, requests the character data generation unit 12 to generate character shape data. The character data management unit 11 also manages the font cache buffer 13 and registers the character shape data generated by the character data generation unit 12 in the font cache buffer 13 also. At the time of registration, if there is no free space in the font cache buffer 13, character shape data registered in the font cache buffer 13 is deleted according to a predetermined algorithm to allocate a free space so that new character shape data is registered.
The character data generation unit 12 generates character shape data, based on the character data passed from the character data management unit 11. The font cache buffer 13 stores the character shape data generated by the character data generation unit 12 for reuse. By storing the character shape data in the font cache buffer 13, for the same character, character shape data need not be generated in the character data generation unit 12, so that character shape data can be rapidly obtained.
The intermediate code management unit 14 stores intermediate codes received from the character data management unit 11 and other processing units in the intermediate code buffer 15. Rendering processing is performed according to the intermediate codes stored in the intermediate code buffer 15, and a rendered image is stored in the band buffer 6. The intermediate code buffer 15 stores intermediate codes generated by an appropriate processing unit.
FIG. 21 is a flowchart showing a conventional procedure for processing character data. In S101, whether input data is character data is judged in the input data analysis unit 1, and if not character data, in step S107, processing corresponding to the type of the input data is performed in the graphics data processing unit 3 or the image data processing unit 4.
If the input data is character data, in S102, the character data management unit 11 judges whether the shape data of a character indicated by the character data is registered in the font cache buffer 13. If the shape data of a character indicated by the character data is registered in the font cache buffer 13, since the registered shape data can be read out for use, control proceeds directly to S105. If the shape data of a character indicated by the character data is not registered in the font cache buffer 13, in S103, shape data corresponding to a character indicated by the character data is generated in the character data generation unit 12. In S104, the character shape data generated in S103 is registered in the font cache buffer 13.
In S105, information such as a rendering position is included in the obtained character shape data to generate an intermediate code, which is written to the intermediate code buffer 15 by the intermediate code management unit 14.
Whether one page of input data has been processed is judged in S106, and if not so, control returns to S101 to repeat processing for the next input data. Upon termination of processing for one page of input data, processing for character data terminates. The intermediate code management unit 14 performs rendering processing, based on the intermediate codes stored in the intermediate code buffer 15, and expands an image in the band buffer 6. The image expanded in the band buffer 6 is sent to the output unit 7, where the image is formed.
FIG. 22 is a schematic diagram showing the locations of character shape data in the font cache buffer and the intermediate code buffer when the conventional procedure for processing character data is executed. If processing for the character data as shown in FIG. 21 is performed, each of the intermediate codes corresponding to the character data will hold character shape data. As a result, as shown in FIG. 22, for each of two or more occurrences of character data to render the same character, the shape data of the character will be written transferred to the intermediate code buffer 15. In FIG. 22, for a character “”, areas to which the shape data of the same character “” is written are indicated in rectangular shape.
This method enables very simple rendering control because, since each of pieces of the character intermediate code data is independent and has no relation with another, the intermediate codes have only to be successively transferred for rendering processing in the case of rendering processing by, e.g. hardware. As seen from FIG. 22, since a large number of pieces of shape data of the same character may be stored in the intermediate code buffer 15, there is the problem that the intermediate code buffer is wastefully consumed. Also, each time an intermediate code indicating the same character is generated and written to the intermediate code buffer 15, shape data is transferred and written, so that it takes a long time to write the intermediate code to the intermediate code buffer 15, hampering rapid processing.
To solve such a problem, an apparatus described in Japanese Published Unexamined Patent Application No. Hei 10-16319 employs the method of not transferring, in principle, character shape data to the intermediate code buffer 15. FIG. 23 is a schematic diagram showing the locations of character shape data in the font cache buffer and the intermediate code buffer in another conventional method for processing character data. This method prevents the intermediate code buffer 15 from being wastefully consumed by placing character shape data in the font cache buffer 13 and writing information for referencing the character shape data in the font cache buffer 13 to the intermediate code buffer 15. The character shape data in the font cache buffer 13 is provided with the number of references from intermediate codes. The number of references is provided to prevent the character shape data from being deleted from the font cache buffer 13 as long as it is referenced from the intermediate codes.
FIG. 24 is a schematic diagram showing the locations of character shape data in the font cache buffer and the intermediate code buffer when there is no free space in the font cache buffer in another conventional method for processing character data. With the method of referencing shape data in the font cache buffer 13 as described above, character shape data in the font cache buffer 13 will not be deleted until no reference has been made from intermediate codes. Consequently, as the number of characters increases, the font cache buffer 13 runs out of free space. If a further character to render occurs, the font cache buffer 13 will become unavailable for registration. In such a case, as shown in FIG. 24, the shape data of a character that could not be registered is temporarily put in the intermediate code buffer 15 and intermediate codes are provided with information for referencing the character shape data temporarily put. In this way, an overflow of the font cache buffer 13 is circumvented.
FIG. 25 is a schematic diagram showing the locations of character shape data in the font cache buffer and the intermediate code buffer when a free space occurs in the font cache buffer, in another conventional method for processing character data. As shown in the above-described FIG. 24, if there is no free space in the font cache buffer 13, character shape data is temporarily put in the intermediate code buffer 15. In this state, by performing rendering processing according to intermediate codes in, e.g., the intermediate code buffer 15, a free space occurs in the font cache buffer 13. For example, in the example shown in FIG. 24, if four intermediate codes to render the character “” have been deleted after being processed, the number of references of the shape data of the character “” is set to 0. At this time, the character shape data temporarily put in the intermediate code buffer 15 is moved to the font cache buffer 13. In the example of FIG. 25, the shape data of a character “” is moved to a free space in the font cache buffer 13. At this time, of intermediate codes stored in the intermediate code buffer 15, information for referencing the shape data of the character “” is updated.
In this way, as soon as a free space occurs in the font cache buffer 13, the shape data of a character temporarily put in the intermediate code buffer 15 is transferred to the font cache buffer 13. Thereby, while the capacity of free space is made as large as possible, the shape data of most recent characters can always be held in the font cache buffer 13.
However, transferring character shape data from the intermediate code buffer 15 to the font cache buffer 13 requires updating information of intermediate codes having referenced the shape data. This entails searching the entire intermediate code buffer 15 for intermediate codes referencing the shape data of a character to be transferred. Therefore, there is the problem that it takes much time to transfer the character shape data from the intermediate code buffer 15 to the font cache buffer 13, hampering rapid execution of the whole character rendering processing.
In the above-described method, character shape data registered in the font cache buffer 13 occupies its space until the space is deallocated when the number of references becomes zero. Therefore, since an expelling process different from an expelling algorithm held by a character data management part of the system is performed, satisfactory result cannot be obtained. Besides, to transfer character shape data from the font cache buffer 13 to the intermediate code buffer 15, all intermediate codes stored in the intermediate code buffer 15 must be checked as described above so that, for intermediate codes referencing the shape data of the transferred character, information for referencing the shape data is updated. For this reason, there has been the problem that processing speed decreases.